package com.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.community.dto.OwnerDTO;
import com.community.po.OwnerPO;
import com.community.vo.OwnerVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ToDo:
 * @Author：高尚磊
 * @date: 2024/6/4 9:03
 */
@Mapper
public interface OwnerDAO extends BaseMapper<OwnerPO> {
//    Page<OwnerPO> page(OwnerDTO ownerDTO);
    @Select("select * from owner")
    List<OwnerPO> find();
    @Insert("INSERT into owner(id,name,home_name,owner_name,nation,phone,people_card,birthday,marital_state,re_type,address,type,sex,re_address,politics,dwell_type,dwell_card) VALUES(#{id},#{name},#{homeName},#{ownerName},#{nation},#{phone},#{peopleCard},#{birthday},#{maritalState},#{reType},#{address},#{type},#{sex},#{reAddress},#{politics},#{dwellType},#{dwellCard})")
    int insert(OwnerPO ownerPO);

    Page<OwnerDTO> page(OwnerDTO ownerDTO);
    OwnerPO getById(Long id);
    OwnerPO getByTel(String phone   );

    int getCount();
}
